<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html lang="en">
<head>
	<title>Latin Verbs - First Conjugation</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<link href="../classics.css" rel="stylesheet" type="text/css">
</head>

<body>

<?php

$verbs = array('amāre' => array('Pres-Stem' => 'am', 'Perf-Stem' => 'amāv', 'Parti-Stem' => 'am'),
               'appellāre' => array('Pres-Stem' => 'appell', 'Perf-Stem' => 'appellāv', 'Parti-Stem' => 'appell'));

$Pres_Indic = array('Active' => array('I' => 'ō', 'Thou' => 'ās', 'He' => 'at', 
                                      'We' => 'āmus', 'Ye' => 'ātis', 'They' => 'ant'),
                    'Passive' => array('I' => 'or', 'Thou' => array('āris', 'āre'), 'He' => 'ātur', 
                                       'We' => 'āmur', 'Ye' => 'āminī', 'They' => 'antur'));
$Pres_Subj = array('Active' => array('I' => 'em', 'Thou' => 'ēs', 'He' => 'et', 
                                     'We' => 'ēmus', 'Ye' => 'ētis', 'They' => 'ent'),
                   'Passive' => array('I' => 'er', 'Thou' => array('ēris', 'ēre'), 'He' => 'ētur', 
                                      'We' => 'ēmur', 'Ye' => 'ēminī', 'They' => 'entur'));

$Present = array('Indicative' => $Pres_Indic, 'Subjunctive' => $Pres_Subj);

$Impf_Indic = array('Active' => array('I' => 'ābam', 'Thou' => 'ābās', 'He' => 'ābat', 
                                      'We' => 'ābāmus', 'Ye' => 'ābātis', 'They' => 'ābant'),
                    'Passive' => array('I' => 'ābar', 'Thou' => array('ābāris', 'ābāre'), 'He' => 'ābātur', 
                                       'We' => 'ābāmur', 'Ye' => 'ābāminī', 'They' => 'ābantur'));
$Impf_Subj = array('Active' => array('I' => 'ārem', 'Thou' => 'ārēs', 'He' => 'āret', 
                                     'We' => 'ārēmus', 'Ye' => 'ārētis', 'They' => 'ārent'),
                   'Passive' => array('I' => 'ārer', 'Thou' => array('ārēris', 'ārēre'), 'He' => 'ārētur', 
                                      'We' => 'ārēmur', 'Ye' => 'ārēminī', 'They' => 'ārentur'));

$Imperfect = array('Indicative' => $Impf_Indic, 'Subjunctive' => $Impf_Subj);

$Fut_Indic = array('Active' => array('I' => 'ābō', 'Thou' => 'ābis', 'He' => 'ābit', 
                                      'We' => 'ābimus', 'Ye' => 'ābitis', 'They' => 'ābunt'),
                    'Passive' => array('I' => 'ābor', 'Thou' => array('āberis', 'ābere'), 'He' => 'ābitur', 
                                       'We' => 'ābimur', 'Ye' => 'ābiminī', 'They' => 'ābuntur'));

$Future = array('Indicative' => $Fut_Indic);

$Perf_Indic = array('Active' => array('I' => 'ī', 'Thou' => 'istī', 'He' => 'it', 
                                      'We' => 'imus', 'Ye' => 'istis', 'They' => array('ērunt', 'ēre')));
$Perf_Subj = array('Active' => array('I' => 'erim', 'Thou' => 'eris', 'He' => 'erit', 
                                     'We' => 'erimus', 'Ye' => 'eritis', 'They' => 'erint'));

$Perfect = array('Indicative' => $Perf_Indic, 'Subjunctive' => $Perf_Subj);

$Plup_Indic = array('Active' => array('I' => 'eram', 'Thou' => 'erās', 'He' => 'erat', 
                                      'We' => 'erāmus', 'Ye' => 'erātis', 'They' => 'erant'));
$Plup_Subj = array('Active' => array('I' => 'issem', 'Thou' => 'issēs', 'He' => 'isset', 
                                     'We' => 'issēmus', 'Ye' => 'issētis', 'They' => 'issent'));

$Pluperfect = array('Indicative' => $Plup_Indic, 'Subjunctive' => $Plup_Subj);

$Fut_Perf_Indic = array('Active' => array('I' => 'erō', 'Thou' => 'eris', 'He' => 'erit', 
                                          'We' => 'erimus', 'Ye' => 'eritis', 'They' => 'erint'));

$Future_Perfect = array('Indicative' => $Fut_Perf_Indic);

$Verb1 = array('Present' => $Present, 'Imperfect' => $Imperfect, 'Future' => $Future,
	           'Perfect' => $Perfect, 'Pluperfect' => $Pluperfect, 'Future Perfect' => $Future_Perfect);


foreach ($Verb1 as $Tense => $vTense) {
	if ($Tense == 'Present' || $Tense == 'Imperfect' || $Tense == 'Future') {
		$stem = $verbs['appellāre']['Pres-Stem'];
	} elseif ($Tense == 'Perfect' || $Tense == 'Pluperfect' || $Tense == 'Future Perfect') {
		$stem = $verbs['appellāre']['Perf-Stem'];
	}
	print "<table border=1>\n";
	print "<caption>$Tense</caption>\n";
	print "<tr><td></td>";
	$tabtxt = array('I' => '', 'Thou' => '', 'He' => '',
	                'We' => '', 'Ye' => '', 'They' => '');
	$l1 = "";
	$l2 = "";
	foreach ($vTense as $mood => $vMood) {
		$nVoices = count($vMood);
		$l1 = $l1 . "<th colspan=$nVoices>$mood</th>";
		foreach ($vMood as $voice => $vVoice) {
			$l2 = $l2 . "<th>$voice</th>";
			foreach ($vVoice as $person => $ending) {
				$tabtxt[$person] = $tabtxt[$person] . "<td>";
				if (is_array($ending)) {
					foreach($ending as $ed) {
						$tabtxt[$person] = $tabtxt[$person] . $stem . $ed . " ";
					}
				} else {
					$tabtxt[$person] = $tabtxt[$person] . $stem . $ending;
				}
				$tabtxt[$person] = $tabtxt[$person] . "</td>";
			}
		}
	}
	print "<tr><td> </td>$l1</tr>\n";
	print "<tr><th>Person</th>$l2</tr>\n";
	foreach ($tabtxt as $person => $words) {
		print "<tr><th>$person</$th>$words</tr>\n";
	}
	print "</table>\n<HR />";
}
?>

</body>
</html>
